﻿
%page inherit Index;

%override Body
<div class="content" style="background-color:{%rand_color()%};">
    
	<table>
	<tr>
		<th>Title</th>
		<th>Category</th>
		<th>Delete</th>
	</tr>
    %foreach(var news in Database.News.FindAll())
	<tr>
		<td>{%news.Category%}</td>
		<td>{%news.Title%}</td>
		<td>
			<form class="ajaxForm" method="post" action="/admin/delete">
	            <div class="result">
	                <input type="hidden" name="id" value="{%news.Link%}" />
					<input type="submit" value="Delete" /> 
	            </div>  
       		</form>
		</td>
	</tr>		
    %end foreach
	</table>

    <form class="ajaxForm" method="post" action="/admin/deleteall">
        <div class="result"><input type="submit" value="Delete All" /></div>
    </form>

    <form class="ajaxForm" method="post" action="/admin/save">
        <input type="text" name="title" size="30" placeholder="Title" />
        <input type="text" name="category" size="30" placeholder="Category" />
        <textarea class="ckeditor" name="body" id="body" rows="20" cols="30"></textarea>
        <input type="submit" value="Save" />
        <div class="result"></div>
    </form>
</div>
%end override 